/**
 * Copyright (c) 2014-2015, Suredy technology Co., Ltd. All rights reserved.
 * @author ZhangMaoren 
 * @since 2015年11月24日
 * @version 0.1
 */
package com.suredy.app.area.model;

import java.io.Serializable;

import com.suredy.app.area.entity.AreaEntity;


/**
 * @author ZhangMaoren
 *
 */
public class Area implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7507802200504295415L;
	
	private String id; //ID

	private String code; //代码,识别码
	

	private String name; //名称
	

	private String longitude; //经度
	

	private String latitude; //纬度
	

	private String description; //描述
	
	
	
	
	/**
	 * @return the id
	 */
	public String getId() {
		return id;
	}

	
	/**
	 * @param id the id to set
	 */
	public void setId(String id) {
		this.id = id;
	}

	
	/**
	 * @return the code
	 */
	public String getCode() {
		return code;
	}

	
	/**
	 * @param code the code to set
	 */
	public void setCode(String code) {
		this.code = code;
	}

	
	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	
	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	
	/**
	 * @return the longitude
	 */
	public String getLongitude() {
		return longitude;
	}

	
	/**
	 * @param longitude the longitude to set
	 */
	public void setLongitude(String longitude) {
		this.longitude = longitude;
	}

	
	/**
	 * @return the latitude
	 */
	public String getLatitude() {
		return latitude;
	}

	
	/**
	 * @param latitude the latitude to set
	 */
	public void setLatitude(String latitude) {
		this.latitude = latitude;
	}

	
	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}

	
	/**
	 * @param description the description to set
	 */
	public void setDescription(String description) {
		this.description = description;
	}
	
	public AreaEntity toPO(){
		AreaEntity po = new AreaEntity();
		po.setId(id);
		po.setCode(code);
		po.setDescription(description);
		po.setLatitude(latitude);
		po.setLongitude(longitude);
		po.setName(name);
		
		return po;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o)
			return true;
		if (o == null || getClass() != o.getClass())
			return false;

		Area other = (Area) o;

		if (id != null ? !id.equals(other.id) : other.id != null) {
			return false;
		}

		if (name != null ? !name.equals(other.name) : other.name != null) {
			return false;
		}

		if (code != null ? !code.equals(other.code) : other.code != null) {
			return false;
		}
		
		if (longitude != null ? !longitude.equals(other.longitude) : other.longitude != null) {
			return false;
		}
		
		if (latitude != null ? !latitude.equals(other.latitude) : other.latitude != null) {
			return false;
		}


		return true;
	}

	@Override
	public int hashCode() {
		return ((id != null ? id.hashCode() : 0) + (name != null ? name.hashCode() : 0) + (code != null ? code.hashCode() : 0) + (longitude != null ? longitude.hashCode() : 0) + (latitude != null ? latitude.hashCode() : 0));
	}

	@Override
	public String toString() {
		return "Repayment[" + "id=" + id + ", name='" + name + "\'" + ", code='" + code + "\', longitude=\'"+ longitude +"\', latitude=\'"+ latitude +"\']";
	}

}
